/**
*@description:字典
@param:{String} refName 下拉框选择组件ref名字
@param:{String} lineCallbackName 接口methods名字
@return:{data}
*/
export function lineMixins(refName, lineCallbackName) {
    return {
        data() {
            this.lines = [
                { code: '01', name: '图一' },
                { code: '02', name: '图二' },
                { code: '03', name: '图三' },
                { code: '04', name: '图四' }
            ];
            return {
                photoLine: this.lines[0].code
            };
        },
        watch: {
            photoLine() {
                this.$refs[refName].$el.querySelector('input').value = this.lines.find(
                    (item) => item.code === this.photoLine
                ).name;
                this[lineCallbackName]();
            }
        }
    };
}
